# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=postgresql-bdr-extension
pkgver=1.0.3
pkgrel=0
pkgdesc="PostgreSQL bidirectional replication (BDR) extension"
url="https://wiki.postgresql.org/wiki/BDR_Administration"
arch="all"
license="PostgreSQL"
makedepends="$depends_dev postgresql-bdr-dev"
subpackages="$pkgname-doc"
# FIXME: mkdir: can't create directory 'tmp_check/data': File exists
options="!check"
# Server seems down for a while, using our own copy for now.
# source="http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/tarballs/bdr-$pkgver.tar.bz2"
source="http://distfiles.alpinelinux.org/distfiles/edge/bdr-$pkgver.tar.bz2"
builddir="$srcdir/bdr-$pkgver"

build() {
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-bdr
	make
}

check() {
	make DESTDIR="$pkgdir" check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
45da12fd3411f2f243ddf16870890042653ca603129c78ce4a54ec128a350c8671cce72c3433971094d0d2b9be699b7aebdefa01ce09380b7d56dc927c0ebea7  bdr-1.0.3.tar.bz2
"
